/* 学生管理系统 - 主样式文件 */

/* 设计规范变量 */
:root {
  /* 颜色系统 */
  --primary-color: #3B82F6;
  --primary-dark: #1E40AF;
  --primary-light: #EFF6FF;
  --success-color: #10B981;
  --warning-color: #F59E0B;
  --error-color: #EF4444;
  --info-color: #06B6D4;
  --secondary-color: #6B7280;
  
  /* 侧边栏规格 */
  --sidebar-width: 256px;
  --sidebar-collapsed-width: 64px;
  --sidebar-bg: #1F2937;
  --sidebar-text: #6B7280;
  --sidebar-active: #3B82F6;
  --sidebar-active-bg: #EFF6FF;
  
  /* 字体规格 */
  --font-nav: 14px;
  --font-sub: 13px;
  --font-helper: 12px;
  
  /* 图标规格 */
  --icon-main: 20px;
  --icon-sub: 16px;
  
  /* 动画 */
  --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* 间距 */
  --indent-level2: 32px;
  --indent-level3: 48px;
}

/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #0F172A;
  color: #E2E8F0;
  line-height: 1.6;
}

/* 暗黑主题布局容器 */
.app-container {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #334155 100%);
}

/* 侧边栏样式 */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(59, 130, 246, 0.2);
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width var(--transition);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.1);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

/* 侧边栏头部 */
.sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  flex-shrink: 0;
  background: rgba(59, 130, 246, 0.1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo i {
  font-size: 2rem;
  color: var(--primary-color);
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.sidebar-logo-text h5 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, #3B82F6, #8B5CF6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-logo-text small {
  font-size: var(--font-helper);
  color: var(--secondary-color);
}

/* 侧边栏导航 */
.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.nav-section {
  margin-bottom: 2rem;
}

.nav-section-title {
  padding: 0 1rem;
  font-size: var(--font-helper);
  font-weight: 600;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.nav-menu {
  list-style: none;
}

.nav-item {
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: #CBD5E1;
  text-decoration: none;
  font-size: var(--font-nav);
  transition: all var(--transition);
  position: relative;
  border-radius: 0.5rem;
  margin: 0 0.5rem;
}

.nav-link:hover {
  background: rgba(59, 130, 246, 0.1);
  color: white;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.1));
  color: var(--primary-color);
  font-weight: 600;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: linear-gradient(180deg, #3B82F6, #8B5CF6);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.nav-link i {
  width: var(--icon-main);
  height: var(--icon-main);
  margin-right: 0.75rem;
  font-size: var(--icon-main);
  text-align: center;
  flex-shrink: 0;
}

.nav-link .nav-text {
  flex: 1;
}

.nav-link .nav-badge {
  margin-left: auto;
  font-size: var(--font-helper);
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--info-color), #06B6D4);
  color: white;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.nav-link .nav-arrow {
  margin-left: auto;
  transition: transform var(--transition);
}

.nav-link[aria-expanded="true"] .nav-arrow {
  transform: rotate(180deg);
}

/* 子菜单 */
.nav-submenu {
  list-style: none;
  background: rgba(15, 23, 42, 0.5);
  overflow: hidden;
  transition: max-height var(--transition);
  border-radius: 0.5rem;
  margin: 0.25rem 0.5rem;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.nav-submenu .nav-link {
  padding-left: var(--indent-level2);
  font-size: var(--font-sub);
  margin: 0;
  border-radius: 0;
}

.nav-submenu .nav-submenu .nav-link {
  padding-left: var(--indent-level3);
}

/* 侧边栏底部 */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(59, 130, 246, 0.2);
  text-align: center;
  flex-shrink: 0;
  background: rgba(59, 130, 246, 0.05);
}

.sidebar-footer p {
  margin: 0.25rem 0;
  font-size: var(--font-helper);
  color: var(--secondary-color);
}

/* 主内容区域 */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: rgba(15, 23, 42, 0.3);
}

.sidebar.collapsed + .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

/* 顶部导航栏 */
.top-navbar {
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* 面包屑导航 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-nav);
}

.breadcrumb-item {
  color: var(--secondary-color);
}

.breadcrumb-item:not(:last-child)::after {
  content: '/';
  margin-left: 0.5rem;
  color: rgba(59, 130, 246, 0.5);
}

.breadcrumb-item.active {
  color: #E2E8F0;
  font-weight: 500;
}

.breadcrumb-item a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition);
}

.breadcrumb-item a:hover {
  color: #60A5FA;
  text-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
}

/* 用户信息区域 */
.user-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.notification-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--secondary-color);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: all var(--transition);
}

.notification-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, var(--error-color), #F87171);
  color: white;
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  transform: translate(50%, -50%);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.user-menu {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: all var(--transition);
}

.user-menu-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.user-name {
  font-size: var(--font-nav);
  font-weight: 500;
  color: #E2E8F0;
}

/* 内容主体 */
.content-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.2);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .user-name {
    display: none;
  }
}

@media (max-width: 640px) {
  .top-navbar {
    padding: 0 1rem;
  }
  
  .content-body {
    padding: 1rem;
  }
  
  .breadcrumb {
    font-size: var(--font-sub);
  }
}
